home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / CUJ9206.ARJ / 1006076A < prev    next >
Text File  |  1992-06-02  |  590b  |  31 lines

  1. #include "makedef.h"
  2.  
  3. long    parse_options(int argc, char *argv[], char *makefile, char *target)
  4. {
  5. int    i = 0;
  6.  
  7. while (++i < argc) {
  8.     if (argv[i][0] != '-')
  9.     fatal_error("all options must begin with '-'.");
  10.     switch(toupper(argv[i][1])) {
  11.     case 'F':
  12.         if (argc > i+1)
  13.             strcpy(makefile,argv[i+1]);
  14.         else
  15.             fatal_error("'-f' argument not found.");
  16.                 break;
  17.  
  18.     case 'T':    
  19.         if (argc > i+1)
  20.             strcpy(target, argv[i+1]);
  21.         else
  22.             fatal_error("'-t' argument not found.");
  23.                 break;
  24.     
  25.     default:    
  26.         fatal_error("invalid option found.");
  27.     }
  28. i++;
  29. }
  30. }
  31.